<template>
	<view class="screen">
		<u-navbar>
			<view slot="left" class="align-center">
				<image @click="$tools.back()" src="@/static/login/back3.png" style="width: 36rpx; height: 36rpx"></image>
			</view>
			<view slot="center">
				<view style="font-weight: 600; font-size: 36rpx; color: #333333">更多筛选条件</view>
			</view>
		</u-navbar>
		<view class="">
			<view style="margin-bottom: 34rpx">
				<view class="laber">最后一次更新</view>
				<view class="flex-wrap">
					<view v-for="(item, index) in list" :key="index" style="padding: 0 10rpx; margin-bottom: 20rpx">
						<view class="flex-center1 btn" :class="{ btn1: current == index }" @click="changest(index)">{{ item.label }}</view>
					</view>
				</view>
			</view>
			<view style="margin-bottom: 34rpx">
				<view class="laber">工作类型</view>
				<view class="flex-wrap">
					<view v-for="(item, index) in list1" :key="index" style="padding: 0 10rpx; margin-bottom: 20rpx">
						<view class="flex-center1 btn" :class="{ btn1: current1 == index }" @click="changest1(index)">{{ item.label }}</view>
					</view>
				</view>
			</view>
			<view style="margin-bottom: 34rpx">
				<view class="laber">薪资范围</view>
				<!-- <view class="flex-wrap">
					<view v-for="(item, index) in list2" :key="index" style="padding: 0 10rpx; margin-bottom: 20rpx">
						<view class="flex-center1 btn">{{ item.label }}</view>
					</view>
				</view> -->
				<view class="flex">
					<input type="number" v-model="salaryStart" placeholder="请输入期望最低" style="text-align: center" />
					<text>-</text>
					<input type="number" v-model="salaryEnd" placeholder="请输入期望最高" style="text-align: center" />
				</view>
			</view>
			<!-- <view style="margin-bottom: 34rpx">
				<view class="laber">工作年限</view>
				<view class="flex-wrap">
					<view v-for="(item, index) in list3" :key="index" style="padding: 0 10rpx; margin-bottom: 20rpx">
						<view class="flex-center1 btn">{{ item.label }}</view>
					</view>
				</view>
			</view> -->
			<view class="flex-between1" style="padding-top: 100rpx">
				<view
					@click="
						current = '';
						current1 = '';
						salaryStart = '';
						salaryEnd = '';
					"
					class="flex-center1"
					style="font-size: 32rpx; color: #1365f9; width: 220rpx; height: 96rpx; background: #ffffff; border-radius: 8rpx; border: 2rpx solid #1365f9"
				>
					清除
				</view>
				<view @click="confirm" class="flex-center1" style="font-size: 32rpx; color: #ffffff; width: 426rpx; height: 96rpx; background: #1365f9; border-radius: 8rpx">
					确定选择
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			current: 0,
			current1: 0,
			salaryStart: '',
			salaryEnd: '',
			list: [{ label: '全部' }, { label: '今天' }, { label: '近一周' }, { label: '近一个月' }],
			list1: [{ label: '全部' }, { label: '长期' }, { label: '临时' }, { label: '小时' }, { label: '计件' }, { label: '其他' }],
			list2: [{ label: '不限' }, { label: '3K以下' }, { label: '3-5K' }, { label: '5-10K' }, { label: '10-20K' }, { label: '20-30K' }, { label: '50K以上' }],
			list3: [{ label: '无经验' }, { label: '小于1年' }, { label: '1-3年' }, { label: '3-5年' }, { label: '10年以上' }, { label: '5-10年' }]
		};
	},
	onLoad(option) {
		console.log(option, 'option');
		this.current = option.value;
		this.current1 = option.value1;
		this.salaryStart = option.value2;
		this.salaryEnd = option.value3;
	},
	methods: {
		changest(index) {
			this.current = index;
		},
		changest1(index) {
			this.current1 = index;
		},
		confirm() {
			this.$tools.prePage().dateType = this.current;
			this.$tools.prePage().workType = this.current1;
			this.$tools.prePage().salaryStart = this.salaryStart; // 把这一页获取的 备注地址 传到上一页uni.navigateBack()
			this.$tools.prePage().salaryEnd = this.salaryEnd;
			this.$tools.back();
		}
	}
};
</script>

<style lang="less" scoped>
.screen {
	padding: 180rpx 32rpx 100rpx;
	.laber {
		font-weight: 600;
		font-size: 32rpx;
		color: #333333;
		margin-bottom: 34rpx;
	}
	.btn {
		width: 202rpx;
		height: 76rpx;
		background: #f8f8f8;
		border-radius: 8rpx;
		font-weight: 400;
		font-size: 28rpx;
		color: #333333;
	}
	.btn1 {
		width: 202rpx;
		height: 76rpx;
		background: rgba(19, 101, 249, 0.1);
		border-radius: 8rpx;
		font-weight: 500;
		font-size: 28rpx;
		color: #1365f9;
	}
}
</style>
